// This is a pregenerated file made by gen_exploit_config.rb. Some sections are labelled as "TODO", you need to enter your values here

#ifndef EXPLOIT_CONFIG
#define EXPLOIT_CONFIG

//Where to load hbl.bin in Ram
// Has to be a place not occupied by the game
// a correct address can be found in psplink, by typing:
// malloc 2 test l 204800
// (the value you want is head address, try h instead of lto get a different address if needed
// Ideally, it should be either smaller than 0x08900000 or higher then 0x09000000.
// If you don't have any address in these areas, you can use GAME_PRELOAD_FREEMEM, which can free some memory *before* you load HBL, and maybe free some useful ranges
#define HBL_LOAD_ADDRESS 0x09E35C00

// To get the correct values for TH_ADDR_LIST, EV_ADDR_LIST, SEMA_ADDR_LIST, GAME_FREEMEM_ADDR,
// the best is to use freemem.rb in the tools folder.
// otherwise you can gather these values with psplink

// Addresses where the threads to delete are defined
// can be found with psplink (thlist)
#define TH_ADDR_LIST { 0x097446f8, 0x09e99c00, 0x09ecbbc0, 0x09ecbc00, 0x09eccbc0, 0x09eccc00, 0x09efebc0, 0x09efec00, 0x09effaf0, 0x09effbc0 }

//Addresses where the event flags to delete can be found
//psplink evlist
//#define EV_ADDR_LIST {  }

//Addresses where the semaphores to delete can be found
//psplink smlist
#define SEMA_ADDR_LIST { 0x097446FC, 0x089541C0, 0x089A3BC8, 0x089A49A0, 0x089A4DB0, 0x089EA940, 0x089EA930, 0x089EA920, 0x089EA918, 0x089EA8F0 }
//#define VPL_ADDR_LIST {  }
//#define FPL_ADDR_LIST {  }

// Define to Free the game module (e.g. minna no golf)
// Not all games need that
#define GAME_FREEMEM_ADDR { 0x089F1CA0 }

#undef HBL_ROOT
// Replace the "TODO" below with the code of your game (e.g UCUS12345)
#define HBL_ROOT "ms0:/PSP/SAVEDATA/ULES00821SLOT00/"

// Define to free additional modules (net modules, etc...) (e.g. patapon2 demo)
// Not all games need that
#define UNLOAD_ADDITIONAL_MODULES

//There is in general no good reason to comment that one
//It searches for additional syscalls.
#define LOAD_MODULES_FOR_SYSCALLS

// Hooks (function overrides/replacements)
// define if your exploit does not have access to sceKernelDcacheWritebackInvalidateAll
#undef CLEAR_CACHE
#define CLEAR_CACHE sceKernelDcacheWritebackAll()

// Define if your exploit does not have access to  sceGeEdramGetSize
// You will see a linker message in the form:
//  undefined reference to `sceGeEdramGetSize'
#define FORCE_HARDCODED_VRAM_SIZE

// Failing calls to sceUtilityCheckNetParam will probably deactivate net access
#define HOOK_ERROR_sceUtilityCheckNetParam

#define HOOK_sceKernelGetThreadId

#define HOOK_sceKernelReferThreadStatus_WITH_dummy

#define HOOK_sceKernelSelfStopUnloadModule_WITH_ModuleMgrForUser_8F2DF740

#define HOOK_sceAudioOutput_WITH_sceAudioOutputBlocking

#define HOOK_sceKernelWakeupThread_WITH_dummy

#define HOOK_sceDisplayWaitVblankStartCB_WITH_sceDisplayWaitVblankStart

#define HOOK_sceKernelSleepThreadCB_WITH_sceKernelDelayThreadCB

#define HOOK_sceImposeSetHomePopup_WITH_dummy

#define HOOK_sceAudioOutput2GetRestSample_WITH_sceAudioGetChannelRestLength

#define HOOK_sceAudioGetChannelRestLen_WITH_sceAudioGetChannelRestLength

#define HOOK_sceKernelDcacheWritebackInvalidateAll_WITH_sceKernelDcacheWritebackAll

#define HOOK_sceCtrlPeekBufferPositive_WITH_sceCtrlReadBufferPositive

// sceKernelReleaseSubIntrHandler is not imported by the game, so we undef the cleanup function. This might reduce HBL compatibility
#undef SUB_INTR_HANDLER_CLEANUP

// if sceIoCHDIR crashes, don't call it, at all
#define CHDIR_CRASH  


#define HOOK_mersenne_twister_rdm

// define DISABLE_P5_STUBS if P5 stubs cause a crash at startup
//#define DISABLE_P5_STUBS

//Vita: all files of HBL in one single folder, no subfolders
/*
#define FLAT_FOLDER
#undef EBOOT_PATH
#define EBOOT_PATH HBL_ROOT"GAME/EBOOT.PBP"
#undef ELF_PATH
#define ELF_PATH HBL_ROOT"GAME/eboot.elf"
#undef HBL_PATH
#define HBL_PATH HBL_ROOT HBL_BIN
#undef LIB_PATH
#define LIB_PATH HBL_ROOT
#undef IMPORTS_PATH
#define IMPORTS_PATH HBL_ROOT
*/

// 8.3 rule
#define HARDCODED_IMPORTS_CONFIG
#define SMALL_FILENAMES

// Adds missing "." ".." entries on Vita
#define VITA_DIR_FIX

// Perfect syscall code: not available anymore in 6.60, so everything here is empty

// For which firmware versions is perfect syscall estimation available?
#define SYSCALLS_KNOWN_FOR_FIRMWARES {  }
#define SYSCALLS_KNOWN_FOR_GO_FIRMWARES { }

// Reference library for syscall estimation, all syscalls for this library must be known
#define SYSCALL_REFERENCE_LIBRARY "sceOpenPSID"

// Syscall offsets, must be defined for all firmwares in SYSCALLS_KNOWN_FOR_FIRMWARES
#define SYSCALL_OFFSETS_500     {  }
#define SYSCALL_OFFSETS_500_CFW {  }

#define SYSCALL_OFFSETS_550     {  }
#define SYSCALL_OFFSETS_550_CFW {  }

#define SYSCALL_OFFSETS_570    {  }
#define SYSCALL_OFFSETS_570_GO {  }

#define SYSCALL_OFFSETS_600    {  }
#define SYSCALL_OFFSETS_600_GO {  }


// Kernel memory dump offsets for the PSP GO
#define SYSCALL_KERNEL_OFFSETS_620 {  }
#define SYSCALL_KERNEL_OFFSETS_630 { } // Not available
#define SYSCALL_KERNEL_OFFSETS_635 { } // Not available

#define RELOC_MODULE_ADDR_1 0x09240000
#define RELOC_MODULE_ADDR_2 0x09260000
#define RELOC_MODULE_ADDR_3 0x09280000
#define RELOC_MODULE_ADDR_4 0x092A0000

#define DEACTIVATE_SYSCALL_ESTIMATION

#define PRE_EXEC
int preLoader_Exec();
int preHBL_Exec();

#endif

